import { RouterProvider, createRouter } from "@tanstack/react-router";
// 忽略报错
// @ts-ignore
import { routeTree } from "../routeTree.gen";
declare module "@tanstack/react-router" {
  interface Register {
    router: typeof router;
  }
}
// 忽略报错
// @ts-ignore
const router = createRouter({
  routeTree,
  context: { auth: undefined!, config: undefined! },
});

export default function useAppRouter() {
  const AppRouterProvider = () => (
    <RouterProvider router={router} context={{}} />
  );
  return {
    AppRouterProvider,
  };
}
